package com.indusfo.spc.mapper;

import com.indusfo.spc.pojo.Dep;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DepMapper {

    //查询编码重复与否
    Integer repeat(Dep dep);

    //查询名称重复与否
    Integer repeatName(Dep dep);


    //新增
    Integer insertDepts(Dep dep);

    //修改
    Integer updateDepts(Dep dep);

    //删除
    Integer deleteDepts(Dep dep);

    //查询
    List<Dep> lookDepts(Dep dep);

    //通过上级部门ID查询子部门数
    Integer lookDeptsBylDepPar(Dep dep);

    // 判断部门编号是否更改
    Integer judgeDepCode(Dep dep);

    // 查询子类ID
    List<Integer> queryChild(@Param("depId") Integer depId);

    /*
    递归查询
    */

  List<Integer> recursionIds(@Param("depId") Integer depId);
  /*
 根据部门名称查询部门
   */
  List<Dep> selectDepByName(String depName);
}
